package org.example.struct.array2;

/**
 * @author liyishan
 * @date 2024/9/4 16:34
 * @apiNote
 */

public class Test01498NumSubseq {
    public static void main(String[] args) {
        int[] nums = {3,5,6,7};
        int target = 9;
        System.out.println(numSubseq(nums, target));
    }

    public static int numSubseq(int[] nums, int target) {
        int res =0;
        int n = nums.length;
        for(int i = 0;i<n;i++){
            for(int j = i;j<n;j++){
                int temp = nums[i]+nums[j];
                if(temp <= target){
                    res++;
                }
            }
        }
        return res;
    }
}
